<include file="Public:header" />
<div class="page-member subpage">
    <div class="form-header">
        <div>
            <div class="line1">
                <div class="fl"><h3>租赁补贴季度 / {$period.name}</h3></div>
                <div class="fr hidden">
                    <form class="search-form" method="post" action="">
                        <input name="field" value="{$context.field}" type="hidden" />
                        <input name="value" value="{$context.value}" type="hidden" />
                        <input name="page" value="{$context.page}" type="hidden" />
                        <input name="order_field" value="{$context.order_field}" type="hidden" />
                        <input name="order_sort" value="{$context.order_sort}" type="hidden" />
                        <input name="offset" value="{$context.offset}" type="hidden" />
                        <input name="id" value="{$context.id}" type="hidden" />
                    </form>
                </div>
            </div>
            <div class="line2">
                <!-- 编辑按钮组 -->
                <if condition="$period.state eq '未启动'">
                    <div class="fl form-btn-group btn-group-edit">
                        <button onclick="action_startSQ();" class="btn-save btn-highlight">启动申请</button>
                        <span>或</span>
                        <a onclick="action_edit();" class="linkBtn" href="javascript:void(0);">编 辑</a>
                    </div>
                </if>
                <if condition="$period.state eq '已启动'">
                    <div class="fl form-btn-group btn-group-edit">
                        <button onclick="action_endSQ();" class="btn-save btn-highlight">结束申请</button>
                        <span>或</span>
                        <a onclick="action_edit();" class="linkBtn" href="javascript:void(0);">编 辑</a>
                    </div>
                </if>
                <!-- 保存按钮组 -->
                <div class="fl form-btn-group btn-group-save hidden">
                    <button onclick="action_save();" class="btn-save btn-highlight">保 存</button>
                    <span>或</span>
                    <a class="linkBtn btn-abort" onclick="action_abort();" href="javascript:void(0);">放弃</a>
                </div>
                <div class="fl form-btn-more">
                    <button class="btn-normal btn-more">
                        更多操作<i class="drop-down"></i>
                    </button>
                    <ul class="more-action hidden">
                        <li><a onclick="action_del2();" href="javascript:void(0);">删 除</a></li>
                        <li><a onclick="action_copy();" href="javascript:void(0);">复 制</a></li>
                    </ul>
                </div>
                <div class="fr form-search-count">
                    <span class="index">{$context.index}/{$page.total}</span>
                    <button onclick="ItemJump({$page.prev.id}, {$page.prev.offset});" class="btn-normal">上一条</button>
                    <button onclick="ItemJump({$page.next.id}, {$page.next.offset});" class="btn-normal">下一条</button>
                </div>
            </div>
        </div>
    </div>
    <div class="form-box2">
        <div>
            <form id="periodForm" method="post" action="">
                <!--表单相关原始信息存储-->
                <input type="hidden" name="old_name" value="{$period.name}" />
                <input type="hidden" name="old_state" value="{$period.state}" />
                <input type="hidden" name="old_year" value="{$period.year}" />
                <input type="hidden" name="old_remarks" value="{$period.remarks}" />
                <table class="form">
                    <tr>
                        <th width="15%">名称<span class="hint">*</span></th>
                        <td width="35%" field="name">{$period.name}</td>
                        <th width="15%">季度代码<span class="hint">*</span></th>
                        <td>{$period.code}</td>
                    </tr>
                    <tr>
                        <th>租赁补贴年份<span class="hint">*</span></th>
                        <td field="year">{$period.year}</td>
                        <th>租赁补贴季度<span class="hint">*</span></th>
                        <td field="season">{$period.season}</td>
                    </tr>
                    <tr>
                        <th>申请开始时间<span class="hint">*</span></th>
                        <td field="start_date">{$period.start_date|date='Y/m/d',###}</td>
                        <th>申请结束时间<span class="hint">*</span></th>
                        <td field="end_date">{$period.end_date|date='Y/m/d',###}</td>
                    </tr>
                    <tr>
                        <th>状态</th>
                        <td>{$period.state}</td>
                        <th>备注</th>
                        <td field="remarks">{$period.remarks}</td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
</div>
<script>
    function action_startSQ(){
        var id = $("input[name=id]").val()
        $.ajax({
            url:"/admin/zlbtPeriod/ajax_startSQ",
            data: {id:id}, type:"POST", dataType:"JSON",
            success: function(data){
                if(data.status){
                    alert("操作成功");
                    location.reload();
                }else{
                    alert(data.info);
                }
            }
        });
    }
    function action_endSQ(){
        var id = $("input[name=id]").val()
        $.ajax({
            url:"/admin/zlbtPeriod/ajax_endSQ",
            data: {id:id}, type:"POST", dataType:"JSON",
            success: function(data){
                if(data.status){
                    alert("操作成功");
                    location.reload();
                }else{
                    alert(data.info);
                }
            }
        });
    }
</script>
<script src="__JS__/zlbtPeriod.js" type="text/javascript" ></script>
<include file="Public:footer" />
